﻿using AutoMapper;
using Common.Communal;
using ERP.Domain.CustomerSupplier;
using MediatR;
using Sell.Api.Write.Application.Command.PhrasesCommand;
using Sell.Services.Phrases;

namespace Sell.Api.Write.Application.CommandHandlers.PhrasesCommandHandlers
{
    public class PhrasesDelCommandHandlers : IRequestHandler<PhrasesDelCommand, ApiResult<int>>
    {
        public IPhrasesServices services { get; }
        public PhrasesDelCommandHandlers(IPhrasesServices _services, IMapper _Mapper)
        {
            services = _services;
        }
        /// <summary>
        /// 销售合同删除
        /// </summary>
        /// <param name="request"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        public async Task<ApiResult<int>> Handle(PhrasesDelCommand request, CancellationToken cancellationToken)
        {
            return await services.DeletePhrase(request.Id);
        }
    }
}
